<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Title</title>
    <script src="__PUBLIC__/js/jquery-easyui-1.5.1/jquery.min.js"></script>
    <script src="__PUBLIC__/js/jquery-easyui-1.5.1/jquery.easyui.min.js"></script>
    <script src="__PUBLIC__/js/jquery-easyui-1.5.1/locale/easyui-lang-zh_CN.js"></script>
    <script src="__PUBLIC__/kindeditor-4.1.10/kindeditor.js"></script>
    <script src="__PUBLIC__/kindeditor-4.1.10/lang/zh_CN.js"></script>
    <script src="__PUBLIC__/JS/myfun.js"></script>

</head>
<body>


<form id="ff" method="post" action="{:U('home/Leave/addpost')}">


    <table>
        <tr>
            <td colspan="2" align="center">加班请假表</td>
        </tr>
        <tr>
            <td>
                人员:
                <select id="cc" class="easyui-combobox" name="memberid" style="width:200px;">
                    <foreach name="members" item="vo">
                        <option value="{$vo.id}">{$vo.name}</option>
                    </foreach>
                </select>
            </td>
            <td>
                类型:

                <input type="radio" value="1" name="leixing">加班
                <input type="radio" value="0" checked="checked" name="leixing">请假
            </td>
        </tr>
        <tr>
            <td>
                时间:
                <input id="dd" name="fftime" type="text" class="easyui-datebox" required="required"> </input>
            </td>
            <td>
                时长:

                <input type="radio" value="1" checked="checked" onchange="radihide()" name="timee">上午
                <input type="radio" value="2" name="timee" onchange="radihide()">下午
                <input type="radio" value="3" name="timee" onchange="radihide()">全天
                <br>
                <input type="radio" value="4" name="timee" onchange="radioshow()">自定义
                <div id="sdtimediv" hidden>
                    开始时间:
                    <input id="ss" name="stime" class="easyui-timespinner" value="08:00" style="width:80px;"
                           data-options="showSeconds:false"/>

                    <br>

                    结束时间
                    <input id="ss2" name="dtime" class="easyui-timespinner" value="12:00" style="width:80px;"
                           data-options="showSeconds:false"/>

                </div>


            </td>
        </tr>
        <tr>
            <td colspan="2">
                备注:
                <textarea name="beizhu" rows="4" cols="60"/>
            </td>


        </tr>
    </table>
    <input type="submit" onclick="sub()" value="提交">
</form>

<script type="text/javascript">


    function sub() {
        $('#ff').form({
            ajax: false,
        });
        $('#ff').form('submit', {
            onSubmit: function (param) {
                var startday = $('#dd').datebox('getValue');
                var v2 = $('#ss2').timespinner('getValue');
                var verty = $('#ss').timespinner('getValue');

                if (v2 <= verty || !startday) {
                    $.messager.alert('我的消息', '请输入正确的时间！', 'info');
                    return false;
                }

                $('#win').window('close');  // close a window
            },
            success: function (data) {
                $.messager.alert('我的消息', '操作完成', 'info');
            }

        });

    }
    function radioshow() {
        $('#sdtimediv').show();
    }
    function radihide() {
        $('#sdtimediv').hide();
    }




</script>
</body>

</html>